<template>
	<view>
		 <CityList :getCity="getCity"></CityList>
	</view>
</template>

<script>
	import CityList from '../../components/bazaar-city_list/index.vue'
	export default {
		data() {
			return {
				
			}
		},
		components:{
			CityList
		},
		methods: {
			getCity(obj) {
				console.log(obj)
				let cityName = obj.city
				if (typeof(cityName) == "object") {
					cityName = cityName.city
				}
				console.log(cityName)
				uni.setStorageSync('current_city', cityName)
				
				uni.switchTab({
					url: '/pages/index/index',
					fail(err) {
						console.log(err)
					}
				})
				console.log('navigate')
			}
		}
	}
</script>

<style>

</style>
